#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int Maxn=2e5+5;
int n,a[Maxn],h[Maxn];
int f[114],vis[114];
int ans=1e18;
void dfs(int x){
	if(x==n+1){
		int now=a[0],sum=0;
		for(int i=1;i<=n;i++){
			sum+=a[f[i]]*((h[f[i]]+now-1)/now-1);
			now=max(now,a[f[i]]);
		}ans=min(ans,sum);
		return;
	}
	for(int i=1;i<=n;i++)
		if(!vis[i])vis[i]=1,f[x]=i,dfs(x+1),vis[i]=0;
}
signed main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	n=read();a[0]=read();
	for(int i=1;i<=n;i++)a[i]=read(),h[i]=read();
	if(n<=10){
		dfs(1);
		printf("%lld\n",ans);
		return 0;
	}
	for(int j=n;j>=max(1ll,n-1000);j--){
		int now=a[0],sum=0;
		for(int i=j;i>=j;i--){
			sum+=a[i]*((h[i]+now-1)/now-1);
			now=max(now,a[i]);
		}for(int i=j+1;i<=n;i++){
			if(i==j)continue;
			sum+=a[i]*((h[i]+now-1)/now-1);
			now=max(now,a[i]);
		}
		for(int i=1;i<j;i++){
			if(i==j)continue;
			sum+=a[i]*((h[i]+now-1)/now-1);
			now=max(now,a[i]);
		}
		
		ans=min(ans,sum);
	}
	printf("%lld\n",ans);
	return 0;
}
/*
10 54
43153 115592
158953 197265
149409 7216
79249 102987
94590 90473
120051 193128
24599 90898
189746 191660
114014 166590
141843 48301
*/
